﻿<UserControl x:Class="P2.Cuberry.MainMenuControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:cal="http://www.codeplex.com/prism"             
    xmlns:inf="clr-namespace:P2.Cuberry.Framework.Infrastructure;assembly=P2.Cuberry.Framework.Infrastructure"
             >
    
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/P2.Cuberry.Framework.Layout;component/Styles/Styles.xaml"/>
                <ResourceDictionary Source="/P2.Cuberry.Framework.Layout;component/Styles/OutlookStyles.xaml"/>
                <ResourceDictionary Source="/P2.Cuberry.Framework.Layout;component/Styles/MainMenuStyles.xaml"/>                
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    

    <Grid>
        <Border BorderBrush="{StaticResource BorderBrush}" BorderThickness="1" SnapsToDevicePixels="True" CornerRadius="5,5,5,5" HorizontalAlignment="Stretch">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>                
                </Grid.ColumnDefinitions>
                
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                
                <!-- This is the label that appears at the top of the TabControl -->
                <StackPanel Grid.Row="0" Style="{StaticResource P2MainMenuHeaderStackPanelStyle}" SnapsToDevicePixels="True" HorizontalAlignment="Stretch" >
                    <TextBlock Name="PanelTitle" Text="Header" Style="{StaticResource P2MainMenuHeaderStyle}"  Margin="5,0" />                        
                </StackPanel>
                
                <!-- Here comes the Sub Menu Items -->
                <ListView Grid.Row="1" x:Name="_subMenuTable" 
                          BorderThickness="0" 
                          HorizontalAlignment="Stretch" 
                          VerticalAlignment="Stretch"
                          IsSynchronizedWithCurrentItem="True" 
                          SelectionChanged="_subMenuTable_SelectionChanged"
                          Width="Auto" MinWidth="220" >
                    
                        <ListView.View>                        
                        <GridView ColumnHeaderToolTip="Sub menu">
                            <GridView.ColumnHeaderContainerStyle>
                                <Style TargetType="GridViewColumnHeader">
                                    <Setter Property="Visibility" Value="Hidden" />
                                    <Setter Property="Height" Value="0" />                                    
                                </Style>
                            </GridView.ColumnHeaderContainerStyle>                            
                            <GridViewColumn Header="MenuIcon" Width="32">
                                <GridViewColumn.CellTemplate>
                                    <DataTemplate>
                                        <Image Source="{Binding SubMenuIcon}"/>
                                    </DataTemplate>
                                </GridViewColumn.CellTemplate>
                            </GridViewColumn>
                            <GridViewColumn Header="MenuItem" DisplayMemberBinding="{Binding Path=MenuItemText}" Width="Auto" />                            
                        </GridView>
                    </ListView.View>
                </ListView>
                
                <!-- This takes the SubenuID -->
                <Label x:Name="SelectedLabel" Content="-------- Sub Menu ID ---------" Grid.Row="2" Visibility="Hidden" Padding="2" Height="0"></Label>
                
                <!-- This is the placeholder for the FindView -->                
                <ItemsControl Margin="0" Grid.Row="3" cal:RegionManager.RegionName="{x:Static inf:RegionNames.FindRegion}" 
                              Height="Auto" HorizontalAlignment="Stretch"  VerticalAlignment="Top" 
                              MinWidth="230" Width="Auto"/>


                <!-- This is the selected content pane that appears in the Outlook Bar -->
                <!-- This is the host panel that contains the tab items -->
                <StackPanel Grid.Row="4" Name="ButtonPanel" >
                </StackPanel>

            </Grid>
        </Border>
    </Grid>
</UserControl>
